<?php

namespace Managers;

class News extends \Lib\Model\DoctrineManager{

    
    public function getAllNews() {
        
        $em = $this->getEntityManager();
        $qb = $em->createQueryBuilder()
                ->select('n')
                ->from('Entities\News', 'n')
                ->orderBy('n.createdAt', 'DESC');

        $result = $qb->getQuery()->getResult();
        
        return $result;
        
    }
    
}